package com.niodata.dp.monitor.sharelib.entity.hadoop;

import com.fasterxml.jackson.annotation.JsonIgnore;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * Created by ndp on 17-12-19.
 */
public class DataNodeInfos implements Serializable {

  private Map<String, DataNodeInfo> dataNodeInfoMap;

  public DataNodeInfo getDataNodeInfo(String name) {
    return dataNodeInfoMap.get(name);
  }

  public Map<String, DataNodeInfo> getDataNodeInfoMap() {
    return dataNodeInfoMap;
  }

  public void setDataNodeInfoMap(
        Map<String, DataNodeInfo> dataNodeInfoMap) {
    this.dataNodeInfoMap = dataNodeInfoMap;
  }

  @JsonIgnore
  public List<DataNodeInfo> getDataNodeInfoList() {
    return new ArrayList<>(dataNodeInfoMap.values());
  }
}
